-
Notifications
You must be signed in to change notification settings - Fork 182
Added provider-consumer example (multiple related packages). #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Added provider-consumer example (multiple related packages). #245
Conversation
@jtpio This is pretty much done (minus some small formatting items and the signalling issue mentioned above) if you want to take a look. Keep in mind that this is intended to be a MINIMAL demonstration of the features needed to implement the provider-consumer pattern (I skipped over several opportunities to make it "better" in favor of highly reduced complexity). |
@fcollonval If you have time to review I'd like to get this approved, the Dual Compatibility document has a spinoff "Plugin System" document (see top post description) that depends on this example so this should be merged first. My plan now is to try to get the document and examples merged first, then do a follow-up PR for the unit tests and repo-referencing for the code snippets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions as promised.
it('should be tested', () => { | ||
expect(1 + 1).toEqual(2); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intend to implement the test here?
@ericsnekbytes does this work with jupyterlab 3? |
@terlan4 It does work in JupyterLab 3, just tested it. The Provider/Consumer pattern is a foundational piece of JupyterLab's design and of its extension system, (so it is certainly relevant to both). |
Also running into this error, which seems to be successful but is returning a non-zero exit code:
|
This example adds three related extension packages:
With all 3 installed in a JupyterLab environment, users will get a provider extension that counts steps (a token + a default service implementation that holds step count data), and two alternate consumer plugins that consume the provider's step_counter service and provide disparate interactivity via buttons in each extension that count steps differently.